get_filename_component(_target_name ${CMAKE_CURRENT_SOURCE_DIR} NAME_WE)

file(GLOB _target_include_files ${CMAKE_CURRENT_SOURCE_DIR}/*.h)
file(GLOB _target_src_files ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
file(GLOB _target_qrc_files ${CMAKE_CURRENT_SOURCE_DIR}/*.qrc)


add_executable(${_target_name} ${_target_include_files} ${_target_src_files} ${_target_qrc_files})

set(osgEarth_Libraries)
if(${osgEarth_FOUND})
    target_compile_definitions(${_target_name} PRIVATE osgEarth_FOUND)
    set(osgEarth_Libraries osgEarth::osgEarth)
endif()

target_link_libraries(${_target_name} 
    PUBLIC 
        OsgQtQuick
        ${osgEarth_Libraries})

set_target_properties(${_target_name} PROPERTIES
    AUTOMOC ON
    AUTORCC ON
    LINK_FLAGS "/DEBUG"
    )

install(TARGETS ${_target_name}
    RUNTIME)